package com.javaweb.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.javaweb.admin.entity.KdlRGR;
import com.javaweb.admin.query.KdlRGRQuery;
import com.javaweb.admin.vo.kdlrgr.KdlRGRVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
public interface KdlRGRMapper extends BaseMapper<KdlRGR> {
    @Select("select isnull(convert(varchar(20),max(sync_time),120),'2024-03-28 00:00:00') from kdl_rgr")
    String GetMaxSyncTime();

    @Select("select * from kdl_rgr where vendorpo=#{orderno} order by materialcode,vendorbatch")
    List<KdlRGR> getRejectDetail(String orderno);

    IPage<KdlRGRVo> getRGRList(IPage<KdlRGRVo> page, @Param("req")KdlRGRQuery req);
    @Select("select isnull(convert(varchar(20),max(sync_time),120),'2024-03-28 00:00:00') from kdl_chg")
    String GetCHGMaxSyncTime();
}
